package action;

import persistence.InstituicaoDAO;
import model.Instituicao;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class RemoveInstituicaoAction extends ActionSupport {

	private Instituicao instituicao;
	
	private int idDaInstituicao;

	public int getIdDaInstituicao() {
		return idDaInstituicao;
	}

	public void setIdDaInstituicao(int idDaInstituicao) {
		this.idDaInstituicao = idDaInstituicao;
	}

	public Instituicao getInstituicao() {
		return instituicao;
	}

	public void setInstituicao(Instituicao instituicao) {
		this.instituicao = instituicao;
	}

	public String remove() {
		System.out.println("############## remove");
		System.out.println("############## remover ID da inst -- " + idDaInstituicao);
		
		/* DAOService.deleteInstituicao(instituicao);
		 * TODO verificar integridade referencial
		 * Acessa o BD e remove a instituicao
		 */
		InstituicaoDAO.getInstance().remover(new Long(idDaInstituicao));
		
		return SUCCESS;
	}

}
